#include <iostream>
#include <algorithm>
#include<vector>
#include <set>
#include <sstream>
using namespace std;

int main() {

	int n;

	cin >> n;
	vector<int> num;
	int tmp, count = 0, count2 = 0, count5 = 0;
	bool flag = true;
	int a1 = 0, a2 = 0, a3 = 0, a5 = 0;
	float a4 = 0.0;

	for (int i = 0; i < n; i++) {
		scanf("%d", &tmp);
		num.push_back(tmp);

		if (tmp % 5 == 0 && tmp % 2 == 0) {
			a1 += tmp;
		}else if (tmp % 5 == 1) {
			flag == true ? (a2 += tmp) : (a2 -= tmp);
			flag = !flag;
			count2++;
		} else if (tmp % 5 == 2) {
			a3++;
		} else if (tmp % 5 == 3) {
			a4 += tmp;
			count++;
		} else if (tmp % 5 == 4 && tmp > a5) {
			a5 = tmp;
			count5++;
		}
	}

	a4 = a4 / count;

	if (a1 > 0) {
		printf("%d ", a1);
	} else {
		printf("N ");
	}
	if (count2 > 0) {
		printf("%d ", a2);
	} else {
		printf("N ");
	}
	if (a3 > 0) {
		printf("%d ", a3);
	} else {
		printf("N ");
	}
	if (a4 > 0) {
		printf("%.1f ", a4);
	} else {
		printf("N ");
	}
	if (count5 > 0) {
		printf("%d", a5);
	} else {
		printf("N");
	}



    return 0;
}	